package com.sias.regexp;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author 吴文杰
 * @version 1.0
 * @createTime 2023-05-03 12:18:45
 */
@SuppressWarnings("all")
public class RegExp02 {
  public static void main(String[] args) {
    // String content = "https://www.bilibili.com";
    String content = "https://www.bilibili.com/video/BV15M4y1h7FQ/?spm_id_from=333.1073.0.0&vd_source=c9efcbd10d4588847e26ae9e275f411c";
    String regStr = "^(https?://)([\\w-]+\\.)+[\\w-]+(/[\\w-/?.=&]*)?$";
    Pattern pattern = Pattern.compile(regStr);
    Matcher matcher = pattern.matcher(content);
    System.out.println(content.matches(regStr));
    if (matcher.find()){
      System.out.println("满足格式");
    }else {
      System.out.println("未满足格式");
    }
  }
}
